<!--
 * @Author: C.
 * @Date: 2022-01-18 10:21:29
 * @LastEditTime: 2022-01-20 14:43:50
 * @Description: file content
-->
<template>
  <div>
    <jv-table :tableObj="tableObj"></jv-table>
  </div>
</template>
<script>
const tableSchema = [
  {
    prop: "name",
    label: "名称"
  },
  {
    prop: "sex",
    label: "性别"
  },
  {
    prop: "money",
    label: "金额",
    filter: "amount",
    align: "right"
  },

  {
    prop: "dateTime",
    label: "日期",
    filter: "date"
  },
  {
    prop: "custom",
    label: "自定义展示",
    customFilter: (val, row) => {
      return `我是${row.name},我有${row.money}元`;
    }
  }
];
const tableData = [
  {
    name: "张三",
    sex: 18,
    money: 1040,
    dateTime: "2022-01-12",
    custom: "2231"
  },
  {
    name: "李四",
    sex: 19,
    money: 10450,
    dateTime: "2022-01-12",
    custom: "2231"
  },
  {
    name: "王五",
    sex: 20,
    money: 1050454,
    dateTime: "2022-01-12",
    custom: "2231"
  },
  {
    name: "刘六",
    sex: 21,
    money: 10770,
    dateTime: "2022-01-12",
    custom: "2231"
  }
];
export default {
  data() {
    return {
      tableObj: {}
    };
  },
  created() {
    this.tableObj = this.$JTable({
      tableSchema: tableSchema,
      title: "数据过滤",
      data: tableData,
      operationCol: false
    });
  }
};
</script>
